package dto

import "time"

// AttachmentQueryParams 附件查询参数
type AttachmentQueryParams struct {
	Page        int     `form:"page" binding:"required,min=1"`
	PageSize    int     `form:"pageSize" binding:"required,min=1,max=10000"`
	Category    string  `form:"category"`
	Filename    string  `form:"filename"`
	ImageType   string  `form:"imageType"`
	Storage     string  `form:"storage"`
	Mimetype    string  `form:"mimetype"`
	MinFilesize *int64  `form:"minFilesize"`
	MaxFilesize *int64  `form:"maxFilesize"`
	StartTime   *string `form:"startTime"`
	EndTime     *string `form:"endTime"`
}

// AttachmentCreateRequest 创建附件请求
type AttachmentCreateRequest struct {
	Category    string    `json:"category"`
	URL         string    `json:"url" binding:"required"`
	ImageWidth  int       `json:"imageWidth"`
	ImageHeight int       `json:"imageHeight"`
	ImageType   string    `json:"imageType"`
	ImageFrames int       `json:"imageFrames"`
	Filename    string    `json:"filename" binding:"required"`
	Filesize    int64     `json:"filesize"`
	Mimetype    string    `json:"mimetype"`
	Extparam    string    `json:"extparam"`
	UploadTime  time.Time `json:"uploadTime"`
	Storage     string    `json:"storage"`
}

// AttachmentUpdateRequest 更新附件请求
type AttachmentUpdateRequest struct {
	Category    string     `json:"category"`
	URL         string     `json:"url"`
	ImageWidth  int        `json:"imageWidth"`
	ImageHeight int        `json:"imageHeight"`
	ImageType   string     `json:"imageType"`
	ImageFrames int        `json:"imageFrames"`
	Filename    string     `json:"filename"`
	Filesize    int64      `json:"filesize"`
	Mimetype    string     `json:"mimetype"`
	Extparam    string     `json:"extparam"`
	UploadTime  *time.Time `json:"uploadTime"`
	Storage     string     `json:"storage"`
}

// AttachmentUploadRequest 上传附件请求
type AttachmentUploadRequest struct {
	Category string `form:"category"`
	Extparam string `form:"extparam"`
}

// AttachmentUploadResponse 上传附件响应
type AttachmentUploadResponse struct {
	ID       uint   `json:"id"`
	URL      string `json:"url"`
	Filename string `json:"filename"`
	Filesize int64  `json:"filesize"`
	Mimetype string `json:"mimetype"`
}
